package com.yuyuto.conn;

import com.yuyuto.conn.model.bean.ItemCardDetail;
import com.yuyuto.conn.model.bean.MemberCard;
import com.yuyuto.conn.model.bean.RedPacketDetail;
import com.yuyuto.conn.model.bean.UCoinAccount;
import com.yuyuto.conn.model.request.ReqAuthCode;
import com.yuyuto.conn.model.request.ReqCouponList;
import com.yuyuto.conn.model.request.ReqCouponPresent;
import com.yuyuto.conn.model.request.ReqEWalletBalance;
import com.yuyuto.conn.model.request.ReqEWalletRecord;
import com.yuyuto.conn.model.request.ReqItemCardDetail;
import com.yuyuto.conn.model.request.ReqItemCardList;
import com.yuyuto.conn.model.request.ReqItemCardOperate;
import com.yuyuto.conn.model.request.ReqItemCardRecord;
import com.yuyuto.conn.model.request.ReqMemberCardList;
import com.yuyuto.conn.model.request.ReqModifyPhoneNoInfo;
import com.yuyuto.conn.model.request.ReqRedPacketDetail;
import com.yuyuto.conn.model.request.ReqRedPacketList;
import com.yuyuto.conn.model.request.ReqRedPacketPresent;
import com.yuyuto.conn.model.request.ReqRedPacketRecord;
import com.yuyuto.conn.model.request.ReqRegister;
import com.yuyuto.conn.model.request.ReqStoreList;
import com.yuyuto.conn.model.request.ReqSwitchPhoneNoCard;
import com.yuyuto.conn.model.request.ReqUCoinChargeTemp;
import com.yuyuto.conn.model.request.ReqUCoinChargeTempOrder;
import com.yuyuto.conn.model.request.ReqUCoinDetail;
import com.yuyuto.conn.model.request.ReqUCoinOperationRecord;
import com.yuyuto.conn.model.request.ReqUsingMemberCardInfo;
import com.yuyuto.conn.model.request.RequestDto;
import com.yuyuto.conn.model.response.CollectorGetAllSiteResponseDto;
import com.yuyuto.conn.model.response.HttpResult;
import com.yuyuto.conn.model.response.RespCollectedPosition;
import com.yuyuto.conn.model.response.RespCounponList;
import com.yuyuto.conn.model.response.RespEWalletBalance;
import com.yuyuto.conn.model.response.RespEWalletRecord;
import com.yuyuto.conn.model.response.RespItemCardList;
import com.yuyuto.conn.model.response.RespItemCardRecord;
import com.yuyuto.conn.model.response.RespMemberCardList;
import com.yuyuto.conn.model.response.RespRedPacketList;
import com.yuyuto.conn.model.response.RespRedPacketRecord;
import com.yuyuto.conn.model.response.RespReportLocation;
import com.yuyuto.conn.model.response.RespStoreList;
import com.yuyuto.conn.model.response.RespUCoinChargeTemp;
import com.yuyuto.conn.model.response.RespUCoinOperationRecord;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by Demon on 2016/11/8.
 */

public interface IYuyutoConnService {

    @Headers({"Content-Type:text/html; charset=UTF-8"})
    @FormUrlEncoded
    @POST("rest/mainpage/login_android")
    Observable<HttpResult<Object>> login(
            @Field("account") String account,
            @Field("pwd") String pwd,
            @Field("channel_id") int channel_id
    );

    @Headers({"Content-Type:text/html; charset=UTF-8"})
    @POST("rest/mainpage/logout_android")
    Observable<HttpResult<Object>> logout();

    @Headers({"Content-Type:text/html; charset=UTF-8"})
    @POST("rest/mainpage/updatepwd")
    Observable<HttpResult<Object>> modifyPwd();


    @POST("member/v1/sendAuthCode")
    Call<HttpResult> sendAuthCode(
            @Body ReqAuthCode reqAuthCode
    );

    @POST("member/v1/signup")
    Observable<HttpResult<Object>> register(
            @Body ReqRegister reqRegister
    );

    @POST("member/v1/changePwd")
    Observable<HttpResult<Object>> changePwd(
            @Body ReqRegister reqRegister
    );

    /**
     * 附近的门店
     */
    @POST("store/v1/getStoreList")
    Observable<HttpResult<RespStoreList>> getStoreList(
            @Body ReqStoreList reqStoreList
    );

    /**
     * 个人页面
     */
    @POST("member/v1/modifyMemberInfo")
    Observable<HttpResult<Object>> modifyMemberInfo(
            @Body ReqModifyPhoneNoInfo reqModifyMemberInfo
    );

    /*
     * 会员卡模块
     */
    @POST("member/v1/switchMemberCard")
    Observable<HttpResult<Object>> switchMemberCard(
            @Body ReqSwitchPhoneNoCard reqSwitchMemberCard
    );

    @POST("member/v1/getMemberCardList")
    Observable<HttpResult<RespMemberCardList>> getMemberCardList(
            @Body ReqMemberCardList reqMemberCardList
    );

    @POST("member/v1/getUsingMemberCardInfo")
    Observable<HttpResult<MemberCard>> getUsingMemberCardInfo(
            @Body ReqUsingMemberCardInfo usingMemberCardInfo
    );

    /*
     * 悠币模块
     */
    @POST("uCoin/v1/getUCoinInfo")
    Observable<HttpResult<UCoinAccount>> getUCoinInfo(
            @Body ReqUCoinDetail reqUCoinDetail
    );

    @POST("uCoin/v1/getOperationRecord")
    Observable<HttpResult<RespUCoinOperationRecord>> getOperationRecord(
            @Body ReqUCoinOperationRecord reqUCoinOperationRecord
    );

    @POST("uCoin/v1/getChargeTemplate")
    Observable<HttpResult<RespUCoinChargeTemp>> getChargeTemplate(
            @Body ReqUCoinChargeTemp reqUCoinChargeTemp
    );

    @POST("uCoin/v1/createTempChargeOrder")
    Observable<HttpResult<String>> createTempChargeOrder(
            @Body ReqUCoinChargeTempOrder reqUCoinChargeTempOrder
    );

    /*
     * 项目卡模块
     */
    @POST("itemCard/v1/getItemCardList")
    Observable<HttpResult<RespItemCardList>> getItemCardList(
            @Body ReqItemCardList itemCardList
    );

    @POST("itemCard/v1/getItemCardDetail")
    Observable<HttpResult<ItemCardDetail>> getItemCardDetail(
            @Body ReqItemCardDetail reqItemCardDetail
    );

    @POST("itemCard/v1/getConsumeRecord")
    Observable<HttpResult<RespItemCardRecord>> getConsumeRecord(
            @Body ReqItemCardRecord reqItemCardRecord
    );

    @POST("itemCard/v1/operateItemCard")
    Observable<HttpResult<Object>> operateItemCard(
            @Body ReqItemCardOperate reqItemCardOperate
    );

    /*
     * 优惠券模块
     */
    @POST("coupon/v1/getCouponList")
    Observable<HttpResult<RespCounponList>> getCouponList(
            @Body ReqCouponList reqCouponList
    );

    @POST("coupon/v1/giftGive")
    Observable<HttpResult<Object>> couponPresent(
            @Body ReqCouponPresent reqCouponPresent
    );

    /*
     * 红包模块
     */
    @POST("redPacket/v1/getRedPacketList")
    Observable<HttpResult<RespRedPacketList>> getRedPacketList(
            @Body ReqRedPacketList reqRedPacketList
    );

    @POST("redPacket/v1/getRedPacketDetail")
    Observable<HttpResult<RedPacketDetail>> getRedPacketDetail(
            @Body ReqRedPacketDetail reqRedPacketDetail
    );

    @POST("redPacket/v1/getConsumeRecord")
    Observable<HttpResult<RespRedPacketRecord>> getConsumeRecord(
            @Body ReqRedPacketRecord reqRedPacketRecord
    );

    @POST("redPacket/v1/giftGive")
    Observable<HttpResult<Object>> giftGive(
            @Body ReqRedPacketPresent reqRedPacketPresent
    );

    /*
     * 电子钱包
     */
    @POST("eWallet/v1/getBalance")
    Observable<HttpResult<RespEWalletBalance>> getBalance(
            @Body ReqEWalletBalance reqEWalletBalance
    );

    @POST("eWallet/v1/getOperationRecord")
    Observable<HttpResult<RespEWalletRecord>> getOperationRecord(
            @Body ReqEWalletRecord reqEWalletRecord
    );


    /**
     * 采集功能
     */


    @POST("collector/v1/getAllSite")
    Observable<HttpResult<CollectorGetAllSiteResponseDto>> getAllSite(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/getCollectedPosition")
    Observable<HttpResult<RespCollectedPosition>> getCollectedPosition(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/addOriginalRecord")
    Observable<HttpResult<RespReportLocation>> reportLocation(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/deletePosition")
    Observable<HttpResult<HttpResult>> deletePosition(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/listPositionRecorded")
    Observable<HttpResult<RespCollectedPosition>> listPositionRecorded(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/createWifiRecord")
    Observable<HttpResult<RespReportLocation>> createWifiRecord(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/deleteWifiRecord")
    Observable<HttpResult<HttpResult>> deleteWifiRecord(
            @Body RequestDto requestDto
    );
//    listPositionRecorded(floorId) {
//        return $http.post('/collector/v1/listPositionRecorded', {floorId})
//    },
//    createWifiRecord(coordX, coordY, floorId, records) {
//        return $http.post('/collector/v1/createWifiRecord', {coordX, coordY, floorId, records})
//    },
//    deleteWifiRecord(positionId) {
//        return $http.post('/collector/v1/deleteWifiRecord', {positionId})
//    },


    @POST("collector/v1/addParkingPosition")
    Observable<HttpResult<RespReportLocation>> addParkingPosition(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/getParkingPosition")
    Observable<HttpResult<RespCollectedPosition>> getParkingPosition(
            @Body RequestDto requestDto
    );

    @POST("collector/v1/deleteParkingPosition")
    Observable<HttpResult<HttpResult>> deleteParkingPosition(
            @Body RequestDto requestDto
    );
}
